
#ifndef _TIMER_
#define _TIMER_

//set the timer total numbers
//if you want to change the numbers, you should change the defination UTIL_TIMER_NUM
// AND the defination patameter timer_flages
#define UTIL_TIMER_NUM 8
typedef void (*p_TimerCallback) (u8_t timer_id );
typedef struct UtilTimer{
	u8_t timer_flages; 	//flags to control open or close the timer;
					//total we have eight timer
	p_TimerCallback callback[UTIL_TIMER_NUM];
	u32_t timer_end[UTIL_TIMER_NUM];
	u32_t last_timer;
}UtilTimer_t;



PUBLIC void TMR_Init(void);
PUBLIC bool TMR_StartSecond(u16_t time_in_second, p_TimerCallback callback, u8_t* timer_id);
PUBLIC bool TMR_Start10Ms(u16_t time_in_10ms, p_TimerCallback callback, u8_t* timer_id);
PUBLIC bool TMR_Stop( u8_t timer_id);
PUBLIC void TMR_Process(void);


#endif
